package springstudy;

import org.springframework.boot.WebApplicationType;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import springstudy.annotation.EnableHelloWorld;

/**
 * 模块装配启动类 {@link springstudy.annotation.EnableHelloWorld}
 * @Author acy
 * @Date 2019/04/24
 */
@EnableHelloWorld
public class EnableHelloWorldBootStrap {
	public static void main(String[] args) {
		ConfigurableApplicationContext applicationContext = new SpringApplicationBuilder(EnableHelloWorldBootStrap.class).web(WebApplicationType.NONE).run(args);
		String helloWorld = applicationContext.getBean("helloWorld",String.class);
		System.out.println("enbable Hello World Bean "+helloWorld);
		//关闭上下文
		applicationContext.close();
	}
}
